// 状态
const state ={
    count: 0
}
// 修改state状态
const mutations = {
    increment(state) {
        state.count++
    }
}

const getters = {
    count: state => state.count
}
// 异步action动作
// 调用 mutations
const actions = {
    addone({ state, commit }) {
        commit('increment', null)
    }
}

export default {
    namespaced: true,
    state: state,
    getters,
    actions,
    mutations
}